﻿using System;
using System.Text;

class StringToHex
{
    static void Main()
    {
        GetHexRepresentation("Hi!");
    }

    public static void GetHexRepresentation(string input)
    {

        var array = Encoding.UTF8.GetBytes(input);
        foreach (var item in array)
        {
            Console.Write(@"\x{0:X}",item);
        }
        Console.WriteLine();
    }
}

